
package com.unionServer.gateway;

import com.unionServer.codecs.UnionDecoder;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.SocketChannel;
import io.netty.handler.logging.LogLevel;
import io.netty.handler.logging.LoggingHandler;
import org.apache.log4j.Logger;


public class FrontEndInitializer extends ChannelInitializer<SocketChannel> {
    final static Logger logger = Logger.getLogger(FrontEndInitializer.class);

    public FrontEndInitializer() {
    }

    @Override
    public void initChannel(SocketChannel ch) {
        ch.pipeline().addLast(new LoggingHandler(LogLevel.INFO));
        ch.pipeline().addLast(new UnionDecoder(Integer.MAX_VALUE, 0, 4, 0, 0, false));
        ch.pipeline().addLast(new FrontendHandler());

    }
}
